
<?php
echo $breadcrumb;
$dp::init();
echo "<scr" . "ipt type=\"text/javascript\">";
$dp->generateDP("srcPeriodStart");
$dp->generateDP("srcPeriodEnd");
echo "</scr" . "ipt>";
$dp->init();
?>
<script language="javascript" type="text/javascript">
	
        $(function(){

                $('#example5').priceFormat({
                    clearPrefix: true
                });



            });
        
    function getValueSingle(kode, nama) {
        try {
            parent.parent._obj_fSendValue(kode, nama, 'nik', 'nama');
        }
        catch(e) { alert(e.message); }
        parent.parent.focus();

<?php echo CloseGB(false);  ?>
                 
    }

    function removeData(kode) {

        if(confirm('Anda yakin akan menghapus data ini?')) {
            location.href = '<?php echo base_url() ?>index.php/kas/kas_bank_delete/' + kode+'/<?php echo urlencode($_SERVER["QUERY_STRING"])?>';
        }
    }
            
    function exportData(kode){
        location.href = '<?php echo base_url() ?>index.php/kas/kas_bank_export/'+kode+'/?<?php echo $_SERVER["QUERY_STRING"]?>';
    }

</script>


<?php
?>
<div id="content">
    
    <div id="content2">
        <div class="DivTable">
            <table class="GridTable">
                <tr>
                    <td colspan="21" class="noborder"><div class="box-control"></div></td>
                </tr>
                <tr class="GridHeader">
                    <td>Jumlah Saldo Saat Ini</td>
                    <td>:</td>
                    <td>
                        <?php
                        if ($numRowsSaldo > 0) {
                            foreach ($resultSaldo as $row) {
                                echo number_format($row->saldo,2);
                            }
                        }else{
                            echo 0;
                        }
                        ?>
                        
                    </td>
                </tr>
                <tr class="GridHeader">
                    <td>Jumlah Saldo Awal Bulan <?=$bulan?></td>
                    <td>:</td>
                    <td>
                        <?php
                        if ($numRowsSaldoAwalBulan > 0) {
                            foreach ($resultSaldoAwalBulan as $row) {
                                echo number_format($row->saldo,2);
                            }
                        }else{
                            echo 0;
                        }
                        ?>
                        
                    </td>
                </tr>
               
            </table>
        </div>
        <br class="bersih" />
    </div>

    <div class="DivTable">

        <form name="fCari" id="fCari" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get" >

            <table class="GridTableFilter">
                <tr>

                    <td>
                        <input class="read-only" type="text" name="srcPeriodStart" id="srcPeriodStart" value="<?php echo $srcPeriodStart; ?>" maxlength="10" size="10" readonly="readonly"  />
                        Sampai
                        <input class="read-only" type="text" name="srcPeriodEnd" id="srcPeriodEnd" value="<?php echo $srcPeriodEnd; ?>" maxlength="10" size="10" readonly="readonly"  />
                    </td>
		</tr>
                <?php
                echo $fp;
                ?>
                <tr>
                    <td>
                        <?php
                        echo $fp2;
                        ?>
                    </td>
                </tr>
            </table>
            <!--        </form>-->
            <?php
            echo form_close();
            ?>
            
              

            <table class="GridTable" style="width:100%">
                <tr>
                    <td colspan="9" class="noborder">
                        <div class="box-control">
                            <?php
                            echo "<a href=\"#\" onclick=\"javascript:exportData('".$bank."')\" class=\"report\" title=\"Export Data\">&nbsp;</a>";
                            echo Greybox::createLink(base_url() . "index.php/kas/kas_bank_edit/0/".$bank, "", "Tambah Data", "add");
                            echo "<a href=\"" . $_SERVER["PHP_SELF"] . "\" class=\"refresh\" title=\"Muat Ulang\">&nbsp;</a>";
                            ?>
                        </div>
                    </td>
                </tr>
                <tr class="GridHeader">
                    <td>No.</td>
                    <td>Id</td>
                    <td>Tanggal</td>
                    <td>Keterangan</td>
                    <td>Kas Masuk</td>
                    <td>Kas Keluar</td>                    
                    <td>Saldo</td>
                    <td>Bank</td>
                    <td>Action</td>
                </tr>
                <?php
                if ($numRows > 0) {
                    setlocale(LC_MONETARY, "en_US");
                    $nomor = $post['offset'];
                    foreach ($result as $row) {
                        $nomor++;
                        $kodecontent = $row->id_kb;
                        $styleTR = "GridItem1";
                        $cur = $row->use_dollar == 1?"$":"Rp";
                        ?>
                        <tr class="<?php echo $styleTR; ?>" >
                            <td width="10"><?php echo $nomor; ?></td>
                            
                            <td><?php echo $row->id_kb; ?></td>
                            <td><?php echo $row->tanggal_kb; ?></td>
                            <td><?php echo $row->keterangan_kb; ?></td>                
                            <td><?php echo $cur.number_format($row->kas_masuk,2); ?></td>
                            <td><?php echo $cur.number_format($row->kas_keluar,2); ?></td>                            
                            <td><?php echo $cur.number_format($row->saldo,2); ?></td>
                            <td><?php echo $row->nama_bank; ?></td>
                            <td width="20"><?php
                            echo Greybox::createLink(base_url() . "index.php/kas/kas_bank_edit/" . $kodecontent . "/".$bank, "", "Ubah Data Kas Bank", "edit", "", 850, 520);
                            echo "<a href=\"#\" class=\"delete\" title=\"Hapus Data\" onclick=\"javascript:removeData('" . $kodecontent . "/".$bank."')\">&nbsp;</a>";
                        ?></td>
                        </tr>
                        <?php
                    }
                } else {
                    ?>
                    <tr class="GridItem1">
                        <td colspan="9" align="center">Tidak ada data</td>
                    </tr>

                    <?php
                }
                ?>
            </table>
    </div>
    <?php echo $paging['pagingView']; ?>
    <br class="bersih" />
</div>

<script type="text/javascript">

    function openURL(url) {
        open(''+ url +'', 'wndStaff', 'width=730,height=500,directories=0,location=0,resizable=1,scrollbars=1,toolbar=0,copyhistory=0,status=0');
        return false;
    }

    jQuery(document).ready(function(){
		
        jQuery(".tr_slide").hide();

        jQuery('.search').click(
        function(){
            jQuery(".tr_slide").slideToggle();
        }
    );
    });

</script>

<script language="javascript">


    jQuery(document).ready(function(){
        jQuery(".tr_slide").hide();

        jQuery('.search').click(
        function(){
            jQuery(".tr_slide").slideToggle();
        }
    );

    });

</script>